package com.hontech.desktoppastacooker.conn

import okhttp3.internal.toHexString

object ErrCode {

    const val OK = 0

    fun msg(ec: Int): String {
        return when (ec) {
            OK -> "正常"
            0x01 -> "FLASH写入失败"
            0x02 -> "FLASH擦除失败"
            0x03 -> "FLASH校验失败"
            0x04 -> "温度传感器异常"
            0x05 -> "门电机堵转"
            0x06 -> "门电机超时"
            0x07 -> "没有收到ack"
            0x08 -> "解析参数错误"
            0x09 -> "无效的参数"
            0x0A -> "无法处理的命令"
            0x0B -> "喷嘴堵转"
            0x0C -> "喷嘴超时"
            0x0D -> "流量计故障/缺水"
            0x0E -> "抽水超时/缺水"
            0x0F -> "没有碗"
            0x10 -> "RFID通信超时"
            else -> "未知错误码${ec.toHexString()}"
        }
    }

}